package a66weding.com.jiehuntong.adapter;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import org.xutils.x;

import java.util.List;

import a66weding.com.jiehuntong.R;
import a66weding.com.jiehuntong.beans.FriendsListBean;
import a66weding.com.jiehuntong.common.utils.ImageOptionsUtil;
import a66weding.com.jiehuntong.widgets.CircularImage;

/**
 * Created by admin on 2016/9/27.
 */
public class MainHelpAdapter extends MyBaseAdapter {

    public MainHelpAdapter(Context context, List data) {
        super(context, data);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
        ViewHolder viewHolder;
        if (convertView==null){
            viewHolder = new ViewHolder();
            convertView = View.inflate(context, R.layout.item_mainhelp,null);
            viewHolder.head = (CircularImage) convertView.findViewById(R.id.diyprogress_roundimage);
            viewHolder.name = (TextView) convertView.findViewById(R.id.item_diyprog_name);
            viewHolder.istainjia = (TextView) convertView.findViewById(R.id.istainjia);
            convertView.setTag(viewHolder);
        }else{
            viewHolder = (ViewHolder) convertView.getTag();
        }
        FriendsListBean.DataBean dataBean = (FriendsListBean.DataBean) data.get(position);
        x.image().bind(viewHolder.head,dataBean.getNvc_TitlePhoto(), ImageOptionsUtil.getcircle_fixy());
        viewHolder.name.setText(dataBean.getName());
        viewHolder.istainjia.setVisibility(View.INVISIBLE);
        return convertView;
    }

    class ViewHolder{
        //头像
        private CircularImage head;
        private TextView name;
        private TextView  istainjia;
    }
}
